<?php	// +----------------------------------------------------------------------	// | 邮件发送历史	// +----------------------------------------------------------------------	// | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.	// +----------------------------------------------------------------------	// | Author: 微尘 <yicmf@qq.com>	// +----------------------------------------------------------------------	namespace app\model\ucenter;	class EmailHistory extends Common	{		// 定义关联		public function email()		{			return $this->belongsTo(Email::class);		}		public function template()		{			return $this->belongsTo(EmailTemplate::class);		}		/**		 * 写入修改		 * @param $data		 */		public static function onBeforeInsert($data)		{			$data['status'] = 1;			$data['token'] = isset($data['token'])?$data['token']:uniqid();			$data['ip'] = request()->ip();		}		protected $type = [			'param' => 'array',		];	}